package lesson07

import com.sun.jndi.cosnaming.IiopUrl.Address
//主构造方法
class Person(var name:String,var age:Int) {
  var address:String=_
  var high:Int=_
  //辅助构造方法
  def this(name:String,age:Int,address: String){
    //必须首先调用主构造方法
    this(name,age)
    this.address=address;
  }

  /**
    *
    */
  def this(name:String,age:Int,address: String,high:Int){
    this(name,age,address)
    this.high=high
  }

}

object Test{
  def main(args: Array[String]): Unit = {
    val tom = new Person("tom",11)
    val ma = new Person("ma",12,"hunan")
    val ma1 = new Person("ma1",12,"beijing",180)

  }
}
